﻿using Avalonia.Controls;
using LiftHub.Data.TodoModels;

namespace LiftHub.Controls;

public partial class AddTodoControl : UserControl
{
    public AddTodoControl()
    {
        InitializeComponent();
    }

    public ToDoModel? Done()
    {
        if (string.IsNullOrEmpty(Title.Text)) return null;
        return new ToDoModel()
        {
            Title = Title.Text, CreateTime = CreateTime.SelectedDate.ToString()!,
            EndTime = EndTime.SelectedDate.ToString()!, IsDone = IsDone.IsChecked!.Value
        };
    }
}